FROM openshift/golang-builder@sha256:4820580c3368f320581eb9e32cf97aeec179a86c5749753a14ed76410a293d83 AS rhel8
ENV __doozer=update BUILD_RELEASE=202202160023.p0.g5c56bc8.assembly.stream BUILD_VERSION=v4.10.0 OS_GIT_MAJOR=4 OS_GIT_MINOR=10 OS_GIT_PATCH=0 OS_GIT_TREE_STATE=clean OS_GIT_VERSION=4.10.0-202202160023.p0.g5c56bc8.assembly.stream SOURCE_GIT_TREE_STATE=clean 
ENV __doozer=merge OS_GIT_COMMIT=5c56bc8 OS_GIT_VERSION=4.10.0-202202160023.p0.g5c56bc8.assembly.stream-5c56bc8 SOURCE_DATE_EPOCH=1643807082 SOURCE_GIT_COMMIT=5c56bc8a0b27f560435f1564de0f3f440e68d889 SOURCE_GIT_TAG=5c56bc8 SOURCE_GIT_URL=https://github.com/openshift/egress-router-cni 
ADD . /go/src/github.com/openshift/egress-router-cni
WORKDIR /go/src/github.com/openshift/egress-router-cni
ENV GO111MODULE=on
ENV VERSION=rhel8 COMMIT=unset
RUN go build -mod vendor -o bin/egress-router cmd/egress-router/egress-router.go

FROM openshift/golang-builder@sha256:4820580c3368f320581eb9e32cf97aeec179a86c5749753a14ed76410a293d83 AS rhel7
ENV __doozer=update BUILD_RELEASE=202202160023.p0.g5c56bc8.assembly.stream BUILD_VERSION=v4.10.0 OS_GIT_MAJOR=4 OS_GIT_MINOR=10 OS_GIT_PATCH=0 OS_GIT_TREE_STATE=clean OS_GIT_VERSION=4.10.0-202202160023.p0.g5c56bc8.assembly.stream SOURCE_GIT_TREE_STATE=clean 
ENV __doozer=merge OS_GIT_COMMIT=5c56bc8 OS_GIT_VERSION=4.10.0-202202160023.p0.g5c56bc8.assembly.stream-5c56bc8 SOURCE_DATE_EPOCH=1643807082 SOURCE_GIT_COMMIT=5c56bc8a0b27f560435f1564de0f3f440e68d889 SOURCE_GIT_TAG=5c56bc8 SOURCE_GIT_URL=https://github.com/openshift/egress-router-cni 
ADD . /go/src/github.com/openshift/egress-router-cni
WORKDIR /go/src/github.com/openshift/egress-router-cni
ENV GO111MODULE=on
RUN go build -mod vendor -o bin/egress-router cmd/egress-router/egress-router.go

FROM openshift/ose-base:v4.10.0.20220216.010142
ENV __doozer=update BUILD_RELEASE=202202160023.p0.g5c56bc8.assembly.stream BUILD_VERSION=v4.10.0 OS_GIT_MAJOR=4 OS_GIT_MINOR=10 OS_GIT_PATCH=0 OS_GIT_TREE_STATE=clean OS_GIT_VERSION=4.10.0-202202160023.p0.g5c56bc8.assembly.stream SOURCE_GIT_TREE_STATE=clean 
ENV __doozer=merge OS_GIT_COMMIT=5c56bc8 OS_GIT_VERSION=4.10.0-202202160023.p0.g5c56bc8.assembly.stream-5c56bc8 SOURCE_DATE_EPOCH=1643807082 SOURCE_GIT_COMMIT=5c56bc8a0b27f560435f1564de0f3f440e68d889 SOURCE_GIT_TAG=5c56bc8 SOURCE_GIT_URL=https://github.com/openshift/egress-router-cni 
RUN mkdir -p /usr/src/egress-router-cni/bin/ && \
    mkdir -p /usr/src/egress-router-cni/rhel7/bin && \
    mkdir -p /usr/src/egress-router-cni/rhel8/bin
COPY --from=rhel7 /go/src/github.com/openshift/egress-router-cni/bin/egress-router /usr/src/egress-router-cni/rhel7/bin/egress-router
COPY --from=rhel8 /go/src/github.com/openshift/egress-router-cni/bin/egress-router /usr/src/egress-router-cni/bin/egress-router
COPY --from=rhel8 /go/src/github.com/openshift/egress-router-cni/bin/egress-router /usr/src/egress-router-cni/rhel8/bin/egress-router

LABEL \
        io.k8s.display-name="Egress Router CNI" \
        io.k8s.description="CNI Plugin for Egress Router" \
        io.openshift.tags="openshift" \
        maintainer="Daniel Mellado <dmellado@redhat.com>" \
        name="openshift/ose-egress-router-cni" \
        com.redhat.component="ose-egress-router-cni-container" \
        io.openshift.maintainer.product="OpenShift Container Platform" \
        io.openshift.maintainer.component="Networking" \
        release="202202160023.p0.g5c56bc8.assembly.stream" \
        io.openshift.build.commit.id="5c56bc8a0b27f560435f1564de0f3f440e68d889" \
        io.openshift.build.source-location="https://github.com/openshift/egress-router-cni" \
        io.openshift.build.commit.url="https://github.com/openshift/egress-router-cni/commit/5c56bc8a0b27f560435f1564de0f3f440e68d889" \
        version="v4.10.0"

